package com.guoyw.seata.account.controller;

import com.guoyw.seata.account.service.ITAccountService;
import com.guoyw.seata.common.dto.AccountDTO;
import com.guoyw.seata.common.response.ObjectResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 账户扣钱
 * author: guoyw
 * create: 2020-09-19 16:19
 **/

@RestController
@RequestMapping("/account")
@Slf4j
public class TAccountController{
  
  @Autowired
  private ITAccountService accountService;
  
  @PostMapping("/dec_account")
  ObjectResponse decreaseAccount(@RequestBody AccountDTO accountDTO) {
    log.info("请求账户微服务：{}", accountDTO.toString());
    return accountService.decreaseAccount(accountDTO);
  }
  
}
